package service

import (
	mysql "mypro/dao/mysql/user"
	"mypro/models"
)

// 登录
func Login(p *models.LoginRequest) (user *models.User, err error) {
	user = &models.User{
		UserName: p.UserName,
		PassWord: p.PassWord,
	}
	if err := mysql.Login(user); err != nil {
		return nil, err
	}
	return user, nil
}
